<template>
  <div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'BForm',
  provide () {
    return {
      Form: this
    }
  },
  props: {
    model: {
      type: Object
    },
    rules: {
      type: Object
    },
    labelWidth: {
      type: String,
      default: '80'
    }
  },
  mounted () {
    
  },
  methods: {
    validate(cb) {
      let promises = this.$children.filter(item => item.prop).map(item => item.validateItem())

      return Promise.all(promises).then( () => cb(true) ).catch(() => cb(false))
    }
  }
}
</script>

<style scoped lang='less'>
</style>